/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dnbW.uiW.queryW.modelW;

import dnbW.dbW.sucxentdbW.Identifier;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.util.HashSet;
import java.util.Set;
import javax.swing.tree.DefaultMutableTreeNode;

/**
 *
 * @author zhouyong
 */
public class OperatorNodeObject extends NodeObject {

    private final PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);
    private Set<Identifier> identityPathMapper
            = new HashSet<Identifier>();
    
    public void addPropertyChangeListener(PropertyChangeListener listener) {
        propertyChangeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        propertyChangeSupport.removePropertyChangeListener(listener);
    }
    
    private String operator;
    
    public OperatorNodeObject(DefaultMutableTreeNode node, String operator){
        super(node);
        this.operator = operator;
    }

    public String getOperator() {
        return operator;
    }

    public void setOperator(String operator) {
        String oldValue = this.operator;
        this.operator = operator;
        propertyChangeSupport.firePropertyChange("operator", oldValue, this.operator);
    }

    public Set<Identifier> getIdentityPathMapper() {
        return identityPathMapper;
    }
}
